Skip to content

Add option to only show failures on test reports#1563

Open
stackoverflow wants to merge 2 commits intoapple:mainfrom
stackoverflow:hide-passed-tests
Open

Add option to only show failures on test reports#1563
stackoverflow wants to merge 2 commits intoapple:mainfrom
stackoverflow:hide-passed-tests

Conversation

@stackoverflow
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@HT154 HT154 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple nits, approving to unblock

Comment thread pkl-commons-cli/src/main/kotlin/org/pkl/commons/cli/commands/TestOptions.kt Outdated
Comment on lines 96 to 106
private void reportResults(TestSectionResults section, AnsiStringBuilder builder) {
if (!section.results().isEmpty()) {
var results =
showOnlyFailed
? section.results().stream().filter(TestResult::isFailure).toList()
: section.results();
if (!results.isEmpty()) {
builder.append(" ").append(section.name()).append('\n');
StringUtils.joinToStringBuilder(
builder, section.results(), "\n", res -> reportResult(res, builder));
StringUtils.joinToStringBuilder(builder, results, "\n", res -> reportResult(res, builder));
builder.append('\n');
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(Not a blocker) This result in output that includes the test module name but no further details:

../pkl/pkl-cli/build/executable/jpkl test --project-dir packages/com.github.dependabot --show-only-failed
module com.github.dependabot.tests.Dependabot

module com.github.dependabot.tests.examples

100.0% tests pass [2 passed], 100.0% asserts pass [2 passed]

Is this really desired? It seems like it might be nice to either omit module names with only passing tests or indicate somehow that all tests in the module passed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really desired?

Yes. The idea is to show all modules being tests. I think hiding the module names might be confusing.
We could show the green passed checkmark after the tests if we are hiding all the results and there's no failure. Open to ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants